<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0">
    <link rel="stylesheet" href="css/Lindex.css">
    <link rel="stylesheet" href="css/Llunbo.css">
    <link href="https://unpkg.com/layui@2.11.5/dist/css/layui.css" rel="stylesheet">
    <link rel="icon" type="image/png" sizes="16x16" href="./img/logo.png">
    <title>游侠客 - 好玩的主题旅行平台</title>
</head>

<body>
    <div class="Index">
        <!-- 顶部 -->
        <div class="indexsearch__box">

            <div class="indexsearch">
                <div class="indexsearch__header">
                    <div class="header__location">
                        <i></i>
                        <p>郑州</p>
                    </div>
                    <div class="header__search" onclick="jump()">
                        <i class="search__button"></i>
                        <input type="text" placeholder="海岛集">
                    </div>
                </div>
            </div>
        </div>
        <div class="index__bg">
            <div class="IndexActivity">

            </div>

            <div class="indexclassify">
                <!-- 周边游 国内游 出境游 新品情报局 定制游 -->
                <div class="indexclassify__main">
                    <div class="div_i" onclick=" jumpto(0)">
                        <i class="first_icon"
                            style="background-image: url(&quot;https://qimg4.youxiake.com/upload/202311/20/1c1a4809443e01b7.png?imageslim&quot;);"></i>
                        周边游
                    </div>
                    <div class="div_i" onclick=" jumpto(1)">
                        <i class="first_icon"
                            style="background-image: url(https://qimg4.youxiake.com/upload/202311/20/908e3dcbb1e87973.png?imageslim);"></i>
                        国内游
                    </div>
                    <div class="div_i" onclick=" jumpto(2)">
                        <i class="first_icon"
                            style="background-image: url(https://qimg4.youxiake.com/upload/202312/26/765cff49c11d45e6.png?imageslim);"></i>
                        出境游
                    </div>
                    <div class="div_i" onclick=" jumpto(3)">
                        <i class="first_icon"
                            style="background-image: url(https://qimg4.youxiake.com/upload/202505/19/073cb0eb14743072.png?imageslim);"></i>
                        新品情报局
                    </div>
                    <div class="div_i" onclick=" jumpto(4)">
                        <i class="first_icon"
                            style="background-image: url(https://qimg4.youxiake.com/upload/202311/20/728575997e835acc.png?imageslim);"></i>
                        定制游
                    </div>

                </div>
                <!-- 户外游 亲子游 摄影游 -->

                <div class="phone-mockup">
                    <div class="carousel-container">
                        <div class="slides-wrapper">
                            <!-- 轮播内容 -->
                            <div class="slide slide-1">
                                <div class="indexclassify__sub__container1 indexclassify__sub__container"></div>
                                <!-- 小圆点指示器 -->
                                <div class="indicators">
                                    <div class="indicator active" data-index="0"></div>
                                    <div class="indicator" data-index="1"></div>
                                </div>
                            </div>

                            <div class="slide slide-2">
                                <div class="indexclassify__sub__container2 indexclassify__sub__container">

                                </div>
                                <!-- 小圆点指示器 -->
                                <div class="indicators">
                                    <div class="indicator" data-index="0"></div>
                                    <div class="indicator active" data-index="1"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 轮播 -->

            <!-- 今日签到 -->
            <div class="indexint">

                <!-- 渲 -->
            </div>
            <!-- 游侠报名了尼泊尔ABC，09-30出发 -->
            <div class="indexnotice">
                <!-- 轮播 -->
                <div class="layui-carousel" id="ID-carousel-demo-1">
                    <div carousel-item class="layui_lunbo">



                    </div>
                </div>

            </div>
            <!-- 确定成行月历 -->
            <div class="indextravel">
                <!-- 1 -->
                <div class="indextravel__items ">
                    <div class="indextravel__items__tit">
                        <i class="indextravel__items__tit__icon"></i>
                        <span>确定成行月历</span>
                    </div>
                    <div class="indextravel__items__flex indextravel__1" onclick="">

                    </div>
                </div>
                <!-- 2 -->
                <div class="indextravel__items indextravel__items1 ">

                    <div class="indextravel__items__flex indextravel__2">



                    </div>
                </div>
            </div>

            <!-- 椭圆轮播 -->
            <div class="IndexBanner">
                <div class="layui-carousel" id="ID-carousel-demo-2">
                    <div carousel-item class="big_swiper"></div>
                </div>
            </div>
            <!-- 本周活动 -->
            <div class="IndexRecommend">
                <div class="IndexRecommend__box">
                    <div class="ScrollX">
                        <div class="IndexRecommend__nav">
                            <div class="font">
                                <span class="font_span" onclick="exchange(0)">本周活动</span>
                                <div class="hide">
                                    <div class="IndexRecommend__site">郑州 </div>
                                </div>

                            </div>

                            <div class="font">
                                <span class="font_span" onclick="exchange(1)">下周活动</span>
                                <div class="hide">
                                    <div class="IndexRecommend__site">郑州 </div>
                                </div>
                            </div>
                            <div class="font">
                                <span class="font_span" onclick="exchange(2)">周边多日</span>
                                <div class="hide">
                                    <div class="IndexRecommend__site">郑州 </div>
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="active_inner">
                        <div class="IndexRecommend__ul" draggable="true">

                        </div>
                    </div>
                </div>

            </div>

            <!-- 品牌活动 -->
            <div class="indexip">
                <div class="indexip__tit">
                    品牌活动
                </div>
                <div class="indexip__box">
                    <!-- 轮播 -->
                    <div class="big_box">
                        <div class="layui-carousel" id="ID-carousel-demo-3">
                            <div carousel-item class="layui_lunbo3">

                            </div>
                        </div>
                    </div>
                    <div class="small_box">

                    </div>
                </div>
            </div>

            <!-- 全球经典 -->
            <div class="Index__Waterfall">
                <div class="nav">
                    <div class="nav__list">

                    </div>
                </div>
                <div class="Waterfall">
                    <div class="flow-demo4" id="ID-flow-demo4">
                        <div class="column">

                        </div>
                    </div>

                </div>

            </div>

            <div class="bottom1">
                <div class="one" onclick="switchTab(this)">
                    <div class="tab-img-container">
                        <img class="bg3 default " src="img/z_shouye2.png"
                            alt="" style="display: none;">
                        <img class="bg3 active" src="./img/z_shouye1.png"
                            alt="" style="display: block;">
                    </div>
                    <p onclick="index()">首页</p>
                </div>
                <div class="one1" onclick="switchTab(this)">
                    <div class="tab-img-container" onclick="jump3(0)">
                        <img class="bg3 default" src="./img/z_dngdan1.png"
                            alt="" style="display: block;">
                        <img class="bg3 active" src="./img/z_dngdan2.png"
                            alt="" style="display: none;">
                    </div>
                    <p onclick="order()">订单</p>
                </div>
                <div class="one2" onclick="switchTab(this)">
                    <div class="tab-img-container" onclick="jump3(1)">
                        <img class="bg3 default" src="./img/z_geren1.png"
                            alt="" style="display: block;">
                        <img class="bg3 active" src="./img/z_geren2.png"
                            alt="" style="display: none;">
                    </div>
                    <p>个人中心</p>
                </div>
            </div>
        </div>
</body>
<script src="js/reset.js"> </script>
<script>
    const indexclassify__sub__container1 = document.querySelector('.indexclassify__sub__container1')
    const indexclassify__sub__container2 = document.querySelector('.indexclassify__sub__container2')
    const indexint = document.querySelector('.indexint')
    const layui_lunbo = document.querySelector('.layui_lunbo')
    const slide1 = document.querySelector('.slide-1')
    const slide2 = document.querySelector('.slide-2')
    const indextravel__1 = document.querySelector('.indextravel__1')
    const indextravel__2 = document.querySelector('.indextravel__2')
    const big_swiper = document.querySelector('.big_swiper')
    const IndexRecommend__ul = document.querySelector('.IndexRecommend__ul')
    const layui_lunbo3 = document.querySelector('.layui_lunbo3')
    const small_box = document.querySelector('.small_box')
    const nav__list = document.querySelector('.nav__list')
    const column = document.querySelector('.column')
    const bottomTabs = document.querySelectorAll('.bottom1 > div');
    let a = 1
    let b = 1
    let icon1 = ''
    let icon2 = ''
    let icon3 = ''
    //底部
    function switchTab(selectedTab) {
        bottomTabs.forEach(tab => {
            const defaultImg = tab.querySelector('.default');
            const activeImg = tab.querySelector('.active');
            if (defaultImg && activeImg) {
                defaultImg.style.display = 'block';
                activeImg.style.display = 'none';
            }
            tab.classList.remove('active');
        });
        const selectedDefaultImg = selectedTab.querySelector('.default');
        const selectedActiveImg = selectedTab.querySelector('.active');
        if (selectedDefaultImg && selectedActiveImg) {
            selectedDefaultImg.style.display = 'none';
            selectedActiveImg.style.display = 'block';
        }
        selectedTab.classList.add('active');
    }
    fetch('https://m.youxiake.com/api/m/index/home', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({

        })
    }).then(res => res.json()).then(res1 => {
        console.log(res1.data)
        // 户外游 亲子游 摄影游
        res1.data.secNavs.forEach((item, index) => {
            if (index < 10) {
                indexclassify__sub__container1.innerHTML += `
                    <div class="indexclassify__sub__list" onclick="jump1(${index})">
                        <i class="sec_icon" style="background-image: url(${item.img});"></i>
                        ${item.text}
                    </div> 
            `
            } else {
                indexclassify__sub__container2.innerHTML += `
                    <div class="indexclassify__sub__list">
                        <i class="sec_icon" style="background-image: url(${item.img});"></i>
                        ${item.text}
                    </div> 
                `
            }

        });
        // slide1.innerHTML=icon1
        // slide2.innerHTML=icon2
        res1.data.functionNavigationList.forEach((item, index) => {
            indexint.innerHTML += `
                <div class="indexint__item">
                    <i class="item__icon" style="background-image: url(${item.icon});"></i>
                    <div class="item__right">
                        <span class="item__title">${item.title}</span>
                        <span class="item__sub item__sub${index}" >${item.sub}</span>
                    </div>

                </div>
            `
        })
        res1.data.broadcastList.forEach((item, index) => {
            layui_lunbo.innerHTML += `
                <div>
                    <div class="indexnotice__item">
                        <div class="indexnotice__left">
                            <i class="indexnotice__icon"></i>
                            <span>${item.tip}</span>
                        </div>
                        <div class="indexnotice__right">
                            GO 
                            <i class="indexnotice__link"></i>
                        </div>
                    </div>
                <div/>
            `
        })
        // layui_lunbo
        //  layuse1()

        //  确定成行月历
        res1.data.operationsModuleVO.calendarItemVO.operationsModuleItemVOList.forEach((item, index) => {
            indextravel__1.innerHTML += `
            <div class="indextravel__item">
                <div class="indextravel__item__image" style="background-image: url(${item.operationProductItemVO.thumb});">
                    <div class="indextravel__item__tag"> 
                    ${item.operationProductItemVO.label}
                    </div>
                    <div class="indextravel__item__tit">
                        ${item.operationProductItemVO.simpleProductName}
                    </div>
                </div>
            </div>
            `
        })

        // console.log(111,res1.data.operationsModuleVO.advertItemVO.operationsModuleItemVOList)
        res1.data.operationsModuleVO.advertItemVO.operationsModuleItemVOList.forEach((item, index) => {
            // console.log(666,item.operationProductItemVO.thumb)
            indextravel__2.innerHTML += `
            <div class="indextravel__item ">
                <div class="indextravel__items__tit">
                    <span >${item.moduleTitle}</span>
                </div>
                <div class="indextravel__item__image" style="background-image: url(${item.operationProductItemVO.thumb});">
                    <div class="indextravel__item__tag font_color" > 
                    ${item.operationProductItemVO.label}
                    </div>
                    <div class="indextravel__item__tit">
                        ${item.operationProductItemVO.simpleProductName}
                    </div>
                </div>
            </div>
            `
        })



        // 大轮播
        res1.data.bannerList.forEach((item, index) => {
            // console.log(9999,item.pic)
            big_swiper.innerHTML +=
                `
                <div>
                    <img class="big_swiper_img" src="${item.pic}" alt="" >
                </div>
            `
        })
        //品牌活动l轮播
        res1.data.brandIPActivityVO.multipleModulesBannerList.forEach((item, index) => {
            layui_lunbo3.innerHTML += `
                <div class="indexip__item__img" style="background-image: url('${item.pic}');">
                    <div class="font_pos">
                        <p class="p1">${item.title}</p>
                        <p class="p2">${item.subTitle}</p>
                    </div>
                </div>

            `

        })
        res1.data.brandIPActivityVO.singleModuleBannerList.forEach((item, index) => {
            small_box.innerHTML += `
                <div class="indexip__list" style="background-image: url('${item.pic}');">
                        <div class="font_box">
                            <p class="p1">${item.title}</p>
                            <p class="p2">${item.subTitle}</p>
                        </div>
                    </div>

            `

        })

        // 全球经典
        res1.data.flowTabList.forEach((item, index) => {
            nav__list.innerHTML += `
                
                <div class="font_1" onclick="change1(${index},${item.type})">${item.typeName}
                        <div class="hide2 duihao">
                            <img class="hide2_img" src="img/Lduihao.png" alt="">
                        </div>
                    </div>
            `
        })


        layuse1()


    }).catch(err => {
        console.log(err)
    })


    small_box.onclick = () => {
        window.location.href = 'index_travel_ip.html'
    }

    Getlist1 = (a = 1, b = 1) => {
        // console.log(666999)
        // column.innerHTML=''

        return fetch(`https://m.youxiake.com/api/m/index/flow/recommend?sitecode=39&city_id=39&type=${a}&page=${b}`).then(res => res.json()).then(res1 => {
            console.log(666, res1)
            res1.data.list.forEach((item, index) => {
                if (index == 0) {
                    column.innerHTML += `
                        <div class="manyou_img" onclick="jump2(${index})" style="background-image: url('${item.dataDetail.image}');"></div>
                    `
                } else if (index == 1) {
                    column.innerHTML += `
                    <div class="next">
                        <div  class="top_bg" onclick="jump2(${index})"  style="background-image: url('	${item.dataDetail.image}');">
                                <img src="img/Lluxing.png" alt="">
                        </div>
                        
                    
                        
                                <span class="name2">${item.dataDetail.title}</span>
                            
                            
                                <div class="enroll__num1">
                                    ${item.dataDetail.numLabel}
                                
                                </div>
                            
                    </div>
                    `
                } else {
                    column.innerHTML += `
                        <div class="top" onclick="jump5(${item.dataDetail.pid})">
                            <div class="top_bg" style="background-image: url('${item.dataDetail.image}');">
                                <span class="city">贵阳出发</span>
                                <span class="trump">爆品</span>
                            </div>
                            
                            <div class="bottom">
                                <span class="name1">清凉贵州 | 贵州首推！奇山秀水苗家风情 6日</span>
                                <div class="types">
                                    <span>跟团游·</span>
                                    <span>懒人慢游·</span>
                                    <div class="days">6天5晚</div>
                                </div>
                                <div class="price__content">
                                    <div class="price">
                                        ￥
                                        <span>3180</span>
                                        起
                                    </div>
                                    <div class="enroll__num">
                                        1.61万人已报名
                                    </div>
                                </div>
                            </div>
                        </div>
                `
                }

            })

        }).catch(err => {
            console.log(err)
        })
    }
    // Getlist1()
    // 全球经典点击事件

    function change1(i, a) {
        column.innerHTML = ''
        // Getlist1(a)
        async function test() {
            try {
                await Getlist1(a)
                // await w1()
            } catch (err) {
                console.log('错误信息')
            }
        }

        test()

        const font_1 = document.querySelectorAll('.font_1')
        let hide2 = document.querySelectorAll('.hide2')
        console.log(6666, font_1.innerHTML)
        font_1.forEach((item, index) => {
            item.style.color = '#000000'
            item.style.fontWeight = 400
            // item.style.fontSize ='16px'
            hide2[index].style.display = 'none'
        })

        event.target.style.color = '#333'
        // item.style.fontSize ='17px'
        event.target.fontWeight = 700

        hide2[i].style.display = 'block'
    }

    // 本周活动点击事件
    Getlist = (i = 0) => {
        IndexRecommend__ul.innerHTML = ''
        fetch('https://m.youxiake.com/api/m/index/home', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({

            })
        }).then(res => res.json()).then(res1 => {
            //本周活动
            res1.data.aroundLump.weekList[i].
                productList.forEach((item, index) => {
                    IndexRecommend__ul.innerHTML += `
                    <div class="one" onclick="jump4(${item.pid})">
                        <div class="IndexRecommend__line__pic" style="background-image: url('${item.image}');">
                            <div class="IndexRecommend__line__tag">
                                ${item.placeLabel}
                            </div>
                            <div class="IndexRecommend__line__jihe">
                                <span class="IndexRecommend__line__days">跟团游</span>
                                <span class="span">·</span>
                                <div class="IndexRecommend__line__placeLabel">户外游</div>
                                <span class="span">·</span>
                                <span class="IndexRecommend__line__days">${item.days}</span>
                            </div>
                        </div>
                        <div class="IndexRecommend__line__title">
                            ${item.simpleName}
                        </div>
                        <div class="div_price"> 
                            <span class="yangtou">￥</span>
                            <span class="price">${item.priceLabel}</span>
                            起
                        </div>
                    </div>
                    `

                })
            const arr1 = `
            <div class="one1">
                <div class="one_1">
                    <span class="way">周边路线</span>
                </div>
                <div class="one_2">
                    <span class="more">显示更多</span>
                </div>
            </div>`
            IndexRecommend__ul.innerHTML += arr1
        }).catch(err => {
            console.log(err)
        })

    }
    Getlist()

    const hide = document.querySelectorAll('.hide')
    const font_span = document.querySelectorAll('.font_span')
    hide[0].style.display = 'block'
    font_span[0].style.color = '#333333'
    font_span[0].style.fontWeight = 700


    function exchange(index) {
        font_span.forEach((item, index) => {
            // console.log(index)
            hide[index].style.display = 'none'
            item.style.color = '#767676'
            item.style.fontWeight = 400

        })
        // event.target.
        event.target.style.color = '#333333'
        event.target.style.fontWeight = 700
        console.log(5555, event.target.style.fontWeight)
        hide[index].style.display = 'block'
        Getlist(index)

    }
    // layuse1()
</script>
<!-- 喇叭轮播 -->
<script src="https://unpkg.com/layui@2.11.5/dist/layui.js"></script>
<script>

    //跳转index_travel_items.html
    const indextravel__items__flex = document.querySelectorAll('.indextravel__items__flex')
    indextravel__items__flex.forEach(item => {
        item.onclick = function () {
            window.location.href = 'index_travel_items.html'
        }
    })



    const layuse1 = () => {
        layui.use(function () {
            var carousel = layui.carousel;
            // 渲染 - 常规轮播
            carousel.render({
                elem: '#ID-carousel-demo-1',
                width: '331',
                height: '24',
                anim: 'updown',
                indicator: 'none',
                arrow: 'none',
                autoplay: true,
            });

            // 渲染 - 常规轮播
            carousel.render({
                elem: '#ID-carousel-demo-2',
                width: '100%',
                height: '5.45rem',
                arrow: 'none',

            });
            // 渲染 - 常规轮播
            carousel.render({
                elem: '#ID-carousel-demo-3',
                width: '6.8rem',
                height: '7.45rem',
                arrow: 'none',
                indicator: 'none',

            });



        });

    }

    jump = () => {
        window.location.href = 'search.html'
    }
    jumpto = (i) => {
        console.log(i)
        if (i == 0) {
            window.location.href = 'tourAround.html'
        } else if (i == 1) {
            window.location.href = 'domesticTour.html'
        } else if (i == 2) {
            window.location.href = 'outboundTour.html'
        } else if (i == 3) {
            window.location.href = 'newProductIB.html'
        } else {
            window.location.href = 'customizedTour.html'
        }
    }
    jump1 = (i) => {
        if (i == 0) {
            window.location.href = 'detail1.html'
        } else if (i == 1) {
            window.location.href = 'detail2.html'
        } else if (i == 2) {
            window.location.href = 'detail3.html'
        } else if (i == 3) {
            window.location.href = 'detail4.html'
        } else {
            window.location.href = 'detail5.html'
        }
    }
    jump2 = (i) => {
        if (i == 0) {
            window.location.href = 'swiperDetail.html'
        } else if (i == 1) {
            window.location.href = 'gotrip.html'
        }
    }
    jump3 = (i) => {
        if (i == 0) {
            window.location.href = 'login.html '
        } else if (i == 1) {
            window.location.href = 'personal.html'
        }

    }


    jump4 = (pid) => {
        console.log(pid)
        window.location.href = 'index_travel_lines.html?pid=' + pid
    }

    jump5 = (pid) => {
        window.location.href = 'index_travel_lines_hot.html?pid=' + pid
    }
</script>
<script>
    layui.use(function () {
        var flow = layui.flow;
        // 流加载实例
        flow.load({
            elem: '#ID-flow-demo4', // 流加载容器
            // scrollElem: '#ID-flow-demo4', // 滚动条所在元素，一般不用填，此处只是演示需要。
            isAuto: true,
            done: function (page, next) { // 执行下一页的回调
                // 模拟数据插入
                setTimeout(function () {
                    var lis = [];

                    // console.log(9999,page)
                    Getlist1(a, page)
                    // 执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
                    // pages 为 Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多

                    next(lis.join(''), page < 10); // 此处假设总页数为 10
                }, 800);
            }
        });
    });
</script>
<script src="js/Llunbo.js"></script>

</html>